package mapping

import (
	"ota/model"
	"ota/model/entity"
)

// UpgradeStrategysEntityToDto entity data transfer
func UpgradeStrategysEntityToDto(upgradeStrategys []*entity.UpgradeStrategy) []*model.UpgradeStrategyInfo {
	out := make([]*model.UpgradeStrategyInfo, 0, len(upgradeStrategys))
	for _, c := range upgradeStrategys {
		out = append(out, UpgradeStrategyEntityToDto(c))
	}
	return out
}

// UpgradeStrategyEntityToDto entity data transfer
func UpgradeStrategyEntityToDto(e *entity.UpgradeStrategy) *model.UpgradeStrategyInfo {
	return &model.UpgradeStrategyInfo{

		Id: e.Id,

		FirmwareIds: e.FirmwareIds,

		Name: e.Name,

		UpgradeType: e.UpgradeType,

		Order: e.Order,

		FailureNotifyMethod: e.FailureNotifyMethod,

		RetryCount: e.RetryCount,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
